3.289 \(\int \sec ^2(e+f x) (a+b \sin ^2(e+f x)) \, dx\)

Optimal. Leaf size=18 \[ \frac{(a+b) \tan (e+f x)}{f}-b x \]

[Out]

-(b*x) + ((a + b)*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0325623, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3191, 388, 203} \[ \frac{(a+b) \tan (e+f x)}{f}-b x \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]^2*(a + b*Sin[e + f*x]^2),x]

[Out]

-(b*x) + ((a + b)*Tan[e + f*x])/f

Rule 3191

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sec ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a+b) \tan (e+f x)}{f}-\frac{b \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-b x+\frac{(a+b) \tan (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0147332, size = 36, normalized size = 2. \[ \frac{a \tan (e+f x)}{f}-\frac{b \tan ^{-1}(\tan (e+f x))}{f}+\frac{b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]^2*(a + b*Sin[e + f*x]^2),x]

[Out]

-((b*ArcTan[Tan[e + f*x]])/f) + (a*Tan[e + f*x])/f + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.05, size = 30, normalized size = 1.7 \begin{align*}{\frac{\tan \left ( fx+e \right ) a+b \left ( \tan \left ( fx+e \right ) -fx-e \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x)

[Out]

1/f*(tan(f*x+e)*a+b*(tan(f*x+e)-f*x-e))

________________________________________________________________________________________

Maxima [A]  time = 1.48076, size = 41, normalized size = 2.28 \begin{align*} -\frac{{\left (f x + e - \tan \left (f x + e\right )\right )} b - a \tan \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x, algorithm="maxima")

[Out]

-((f*x + e - tan(f*x + e))*b - a*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.75496, size = 85, normalized size = 4.72 \begin{align*} -\frac{b f x \cos \left (f x + e\right ) -{\left (a + b\right )} \sin \left (f x + e\right )}{f \cos \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x, algorithm="fricas")

[Out]

-(b*f*x*cos(f*x + e) - (a + b)*sin(f*x + e))/(f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin ^{2}{\left (e + f x \right )}\right ) \sec ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)**2*(a+b*sin(f*x+e)**2),x)

[Out]

Integral((a + b*sin(e + f*x)**2)*sec(e + f*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.12307, size = 66, normalized size = 3.67 \begin{align*} -\frac{{\left (f x - \pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + e - \tan \left (f x + e\right )\right )} b - a \tan \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2),x, algorithm="giac")

[Out]

-((f*x - pi*floor((f*x + e)/pi + 1/2) + e - tan(f*x + e))*b - a*tan(f*x + e))/f